{*include file="template/admin_head.htm"*}
<script type="text/javascript">
$(function(){
	$(".del_item").live("click",function(){
		var index = $("input").index($(this));
		$("input").get(index-1).value='';
		$("input").get(index-2).value='';
		$("input").get(index-3).value='';
		//$(this).parent().parent().remove();
	});
	
	$(".item").autocomplete("/admin/ajax-act_searchgoods.htm", {
		minChars: 1,					//最少输入字条
		max: 12,
		autoFill: false,				//是否选多个,用","分开
		mustMatch: true,				//是否全匹配, 如数据中没有此数据,将无法输入
		matchContains: true,			//是否全文搜索,否则只是前面作为标准
		scrollHeight: 200,
		width:700,
		multiple:false,
		dataType:'html',
		formatItem: function(row, i, max) {					//显示格式
		
			return "<span style='width:450px'>"+row[0]+"</span><span style='width:70px'>ID:"+row[1]+"</span><span style='width:80px'>"+row[2]+"元</span>";
		},
		formatMatch: function(row, i, max) {				//以什么数据作为搜索关键词,可包括中文,
		   return row[1];

		},
		formatResult: function(row) {					//返回结果		
			return row[0];
		}
	});				
	
	$(".item").result(function(event, row, formatted) {				//额外触发,可不要
		 var index = $("input").index($(this));
		 $("input").get(index-1).value=row[1];
		 $("input").get(index+1).value=row[2];

	});
	
})
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="containtable" class="{*$cf_controller*}">
    <tr>
	<td valign="top" bgcolor="#FFFFFF">
	    <div class="wrapper  pr_8">
		
		<div class="content_panel_title">
                    <div class="contentpanelleft"></div>
                    <div class="contentpanelcenter">
                        <span class="contentpanelcenter_font">自定义管理</span>

                        </div>
                    <div class="contentpanelrihgt"></div>
                </div>             
                <div class="content_table_center_style">
                    <div class="p8">
			<form name="list_form" id="list_form" method="post" action="{*$cf_self_page*}">
			    <input name="act" type="hidden" value="index" />
			    <input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
			    <table width="100%" class="tbl tbl_nbr">
				<thead>
				    <tr class="thd">
					
					<td width="20%" align="center" class="thr">分类名称</td>
					<td width="65%" align="center" class="thr">商品清单</td>
					<td width="15%" align="center" class="thr">是否显示</td>
					</tr>
				</thead>
				<tbody>
				    {*for $no=0 to 6*}

				    <tr onmouseover="this.style.backgroundColor='#ffC'" onmouseout="this.style.backgroundColor='#ffF'">
					
					<td align="center"><input name="item_cate{*$no*}" type="text"  value="{*$data_ary[$no]['title']*}" /></td>
					<td align="center"><div class="item_part"> <ul id="item_list">
						<li>
							<p>
								<span class="span1" style="width:400px">商品</span>
								<span class="span1">价格</span>
								<span>操作</span>
								</p></li>
						 {*for $no2=0 to 4*}
						<li>
							<span class="span1" style="width:400px"><input name="item_id{*$no*}[]" type="hidden"  value="{*$data_ary[$no]['list'][$no2]['goods_id']*}" /><input name="item_title{*$no*}[]" type="text"  size="80" value="{*$data_ary[$no]['list'][$no2]['goods_title']*}" class="item" /></span>
							<span class="span1"><input name="item_price{*$no*}[]" type="text" value="{*$data_ary[$no]['list'][$no2]['goods_price']*}" size="8" /></span>
							<span><input type="button" value="清除" class="del_item" /></span>
							</li>
						{*/for*} 	
						
					</ul></div></td>
					<td align="center">{*html_radios name=item_status|cat:$no options=$cf_info_var_common['yesno'] checked=$data_ary[$no]['status']|default:'0'*}</td>
					</tr>
				   {*/for*} 
				    <tr>
				    	<td colspan="3">&nbsp;</td>
			    	</tr>
				    <tr class="tft">
					<td colspan="3" align="center" style="padding:0;">
					    <input type="submit" name="Submit" class="myinput" value="提 交" />
                                            &nbsp;&nbsp;
                                            <input type="button" name="back" class="myinput" value="返 回" onclick="window.history.back()" />
					</td>
				    </tr>
				</table>
			</form>
		    </div>
                </div>
		<div class="content_main_bottom">
                    <div class="content_main_bottom_left"></div>
                    <div class="content_main_bottom_right"></div>
                </div>
            </div>
            <br />
            

	    </div>
	</td>
	</tr>
</table>
{*include file="template/admin_foot.htm"*}